home *** CD-ROM | disk | FTP | other *** search
/ AOL File Library: 2,801 to 2,900 / aol-file-protocol-4400-2801-to-2900.zip / AOLDLs / C++ Files Library / CWASTE C++ text editing routi / CWASTE folder.sit / CWASTE folder / WASTEIntf.h < prev    next >
Text File  |  1994-07-28  |  20KB  |  543 lines

  1. /*
  2. // { WASTE PROJECT: }
  3. // { Internal interface: constants, types and inline code }
  4.  
  5. // { Copyright ⌐ 1993-1994 Marco Piovanelli }
  6. // { All Rights Reserved }
  7. */
  8.  
  9. /*    useful macros for testing, setting and clearing bits */
  10.  
  11. #include <TextServices.h>
  12. #include <AERegistry.h>
  13.  
  14. #define BTST( FLAGS, BIT )    (((FLAGS) &  (1L << (BIT)))!=0)
  15. #define BSET( FLAGS, BIT )  ((FLAGS) |= (1L << (BIT)))
  16. #define BCLR( FLAGS, BIT )  ((FLAGS) &= (~(1L << (BIT))))
  17.  
  18. #define ABS(A) ((A) > 0 ? (A) : -(A))
  19.  
  20. #define BSL(A, B)    (((long)A) << (B))
  21. #define BSR(A, B)    (((long)A) >> (B))
  22.  
  23. #include "LongCoords.h"
  24. #include <limits.h>
  25.  
  26. /*    alignment styles */
  27.  
  28. enum {
  29.     weFlushLeft         =    -2,        /* flush left */
  30.     weFlushRight        =    -1,        /* flush right */
  31.     weFlushDefault        =     0,        /* flush according to system direction */
  32.     weCenter            =     1,        /* centered */
  33.     weJustify            =     2        /* fully justified */
  34. };
  35.  
  36. // { values for the edge parameter }
  37.  
  38. enum {
  39.     kLeadingEdge = -1,
  40.     kTrailingEdge = 0
  41. };
  42.  
  43. // { control character codes }
  44.  
  45. enum {
  46.     kBackspace = 8,
  47.     kEOL = 13,
  48.     kArrowLeft = 28,
  49.     kArrowRight = 29,
  50.     kArrowUp = 30,
  51.     kArrowDown = 31
  52. };
  53.  
  54. // { bit equates for QuickDraw styles }
  55.  
  56. enum {
  57.     tsBold = 0,
  58.     tsItalic = 1,
  59.     tsUnderline = 2,
  60.     tsOutline = 3,
  61.     tsShadow = 4,
  62.     tsCondense = 5,
  63.     tsExtend = 6
  64. };
  65.  
  66. // { bit equates for the tsFlags field of the WETextStyle record }
  67. enum {
  68.     tsTSMHilite = 4,                        // { set if style run is part of active input area }
  69.     tsTSMSelected = 5,                        // { set for selected raw/converted text }
  70.     tsTSMConverted = 6,                        // { set for converted text, clear for raw text }
  71.     tsRightToLeft = 7                        // { reserved for future use }
  72. };
  73.  
  74. // { bit equates for the mode parameter in WESetStyle and WEContinuousStyle }
  75. enum {
  76.     kModeFont = 0,
  77.     kModeFace = 1,
  78.     kModeSize = 2,
  79.     kModeColor = 3,
  80.     kModeAddSize = 4,
  81.     kModeToggleFace = 5,
  82.     kModeReplaceFace = 6,
  83.     kModeFlags = 15
  84. };
  85.  
  86. // { values for the mode parameter in WESetStyle and WEContinuousStyle }
  87. enum {
  88.     weDoFont            =    0x0001,
  89.     weDoFace            =    0x0002,
  90.     weDoSize            =    0x0004,
  91.     weDoColor            =    0x0008,
  92.     weDoAll                =    weDoFont + weDoFace + weDoSize + weDoColor,
  93.     weDoAddSize            =    0x0010,
  94.     weDoToggleFace        =    0x0020,
  95.     weDoReplaceFace        =    0x0040,
  96.     weDoFlags            =    0x8000
  97. };
  98.  
  99. // { values for WEFeatureFlag action parameter }
  100. enum {
  101.     weBitClear = 0,                                // { disables the specified feature }
  102.     weBitSet = 1,                                // { enables the specified feature }
  103.     weBitTest = -1                                // { returns the current setting of the specified feature }
  104. };
  105.  
  106. // { bit equates for the flags field in the WE record }
  107. // { bits 0..15 can be used to turn on and off specific features with WEFeatureFlag }
  108. // { bits 16..31 are used internally and should not be modified }
  109.  
  110. // { private flags }
  111. enum {
  112.     weFHasColorQD = 31,                        // { Color QuickDraw is available }
  113.     weFHasTextServices = 30,                // { Text Services Manager is available }
  114.     weFNonRoman = 29,                        // { at least one non-Roman script is enabled }
  115.     weFDoubleByte = 28,                        // { a double-byte script is installed }
  116.     weFBidirectional = 27,                    // { reserved for future use }
  117.     weFUseDualCaret = 26,                    // { reserved for future use }
  118.     weFCaretVisible = 24,                    // { the caret is currently visible }
  119.     weFMouseTracking = 23,                    // { set internally during mouse tracking }
  120.     weFAnchorIsEnd = 22,                    // { anchor offset is selEnd }
  121.     weFUseNullStyle = 21,                    // { a null style is associated with the empty selection }
  122.     weFActive = 20                            // { we're active }
  123. };
  124.  
  125. // { public flags }
  126. enum {
  127.     weFDrawOffscreen = 11,                    // { draw text offscreen for smoother visual results }
  128.     weFUseTempMem = 10,                        // { use temporary memory for main data structures }
  129.     weFInhibitRecal = 9,                    // { if set, recals and redraws are inhibited }
  130.     weFDragAndDrop = 8,                        // { reserved for future use }
  131.     weFIntCutAndPaste = 7,                    // { reserved for future use }
  132.     weFOutlineHilite = 2,                    // { frame selection range when text pane is inactive }
  133.     weFAutoScroll = 0                        // { automatically scroll text when cursor is outside pane }
  134. };
  135.  
  136. // { masks for setting the feature bits }
  137. enum {
  138.     weDoAutoScroll = 1 << weFAutoScroll,
  139.     weDoOutlineHilite = 1 << weFOutlineHilite,
  140.     weDoIntCutAndPaste = 1 << weFIntCutAndPaste,
  141.     weDoDragAndDrop = 1 << weFDragAndDrop,
  142.     weDoInhibitRecal =  1 << weFInhibitRecal,
  143.     weDoUseTempMem = 1 << weFUseTempMem,
  144.     weDoDrawOffscreen = 1 << weFDrawOffscreen 
  145. };
  146.  
  147. // { scrap types }
  148. enum {
  149.     kTypeText = 'TEXT',
  150.     kTypeStyles = 'styl'
  151. };
  152.  
  153. // { selectors for WEGetInfo/WESetInfo }
  154. enum {
  155.     weClickLoop = 'clik',
  156.     weLineArray = 'line',
  157.     wePort = 'port',
  158.     weRefCon = 'refc',
  159.     weRunArray = 'runa',
  160.     weScrollProc = 'scrl',
  161.     weStyleTable = 'styl',
  162.     weText = 'text',
  163.     weTSMDocumentID = 'tsmd',
  164.     weTSMPostUpdate = 'post',
  165.     weTSMPreUpdate = 'pre '
  166. };
  167.  
  168. // { values for WEAllocate allocFlags parameter }
  169. enum {
  170.     kAllocClear = 0x0001,                        // { clear handle after allocation }
  171.     kAllocTemp = 0x0002                        // { use temporary memory if available }
  172. };
  173.  
  174. // { other miscellaneous constants }
  175. enum {
  176.     kMinFontSize = 1,                    // { minimum valid font size }
  177.     kMaxFontSize = SHRT_MAX,            // { maximum valid font size }
  178.     kInvalidOffset = -1                 // { used to flag an invalid or nonexistent offset }
  179. };
  180.  
  181. static long kOneToOneScaling = 0x00010001;        // { 1:1 scaling ratio }
  182.  
  183. // { WETextStyle is just a familiar TextStyle record as defined by TextEdit, where }
  184. // { tsFace is redefined as SignedByte (rather than Style) so that the filler byte }
  185. // { becomes "visible" from Pascal and can be used to store internal flags }
  186.  
  187. #if defined(powerc) || defined (__powerc)
  188. #pragma options align=mac68k
  189. #endif
  190.  
  191. typedef struct WETextStyle {
  192.     short tsFont;                /* font family number */
  193.     char tsFace;                /* set of QuickDraw styles */
  194.     char tsFlags;                /* flags (FOR INTERNAL USE ONLY) */
  195.     short tsSize;                /* font size, in integer points */
  196.     RGBColor tsColor;            /* absolute red-green-blue color */
  197. } WETextStyle, *WETextStylePtr, **WETextStyleHandle;
  198.  
  199. typedef struct WERunAttributes {
  200.     short runHeight;            /* style run height (ascent + descent + leading) */
  201.     short runAscent;            /* font ascent */
  202.     WETextStyle runStyle;        /* text style */
  203. } WERunAttributes, *WERunAttributesPtr, **WERunAttributesHandle;
  204.  
  205. typedef struct WERunInfo {
  206.     long runStart;                /* byte offset to first character of this style run */
  207.     long runEnd;                /* byte offset to first character of next style run */
  208.     WERunAttributes runAttrs;    /* run attributes */
  209. } WERunInfo, *WERunInfoPtr, **WERunInfoHandle;
  210.  
  211. typedef struct WEStyleScrapElement {
  212.     long scrpStartChar;
  213.     WERunAttributes scrpAttrs;
  214. } WEStyleScrapElement, *WEStyleScrapElementPtr, **WEStyleScrapElementHandle;
  215.  
  216. // { another "view" for the familiar TextEdit 'styl' Clipboard type }
  217.  
  218. typedef struct WEStyleScrap {
  219.     short scrpNStyles;
  220.     WEStyleScrapElement scrpStyleTab[1];
  221. } WEStyleScrap, *WEStyleScrapPtr, **WEStyleScrapHandle;
  222.  
  223. // { the purpose of the GrafPort1 declaration is to redefine the txFace field as SignedByte, }
  224. // { rather than Style ( = set of StyleItem), to avoid using THINK Pascal runtime routines }
  225. // { for set manipulation }
  226.  
  227. typedef struct GrafPort1
  228. {
  229.     short                        device;
  230.     BitMap                        portBits;
  231.     Rect                        portRect;
  232.     RgnHandle                    visRgn;
  233.     RgnHandle                    clipRgn;
  234.     Pattern                        bkPat;
  235.     Pattern                        fillPat;
  236.     Point                        pnLoc;
  237.     Point                        pnSize;
  238.     short                        pnMode;
  239.     Pattern                        pnPat;
  240.     short                        pnVis;
  241.     short                        txFont;
  242.     char                        txFace;
  243.     char                        filler;
  244.     short                        txMode;
  245.     short                        txSize;
  246.     Fixed                        spExtra;
  247.     long                        fgColor;
  248.     long                        bkColor;
  249.     short                        colrBit;
  250.     short                        patStretch;
  251.     Handle                        picSave;
  252.     Handle                        rgnSave;
  253.     Handle                        polySave;
  254.     QDProcsPtr                    grafProcs;
  255. } GrafPort1, *GrafPtr1;
  256.  
  257. typedef struct QDEnvironment {
  258.     GrafPtr envPort;
  259.     PenState envPen;
  260.     WETextStyle envStyle;
  261.     short envMode;
  262. } QDEnvironment;
  263.  
  264. typedef struct WEStyleScrapPair {
  265.     WEStyleScrapElement first;
  266.     WEStyleScrapElement second;
  267. } WEStyleScrapPair, *WEStyleScrapPeek;
  268.  
  269. typedef struct RunArrayElement {
  270.     long runStart;                        // { offset to first character in style run }
  271.     long styleIndex;                    // { index into style table (high word currently unused) }
  272. } RunArrayElement, *RunArrayElementPtr, **RunArrayElementHandle;
  273.  
  274. typedef struct RunArrayPair {
  275.     RunArrayElement first;
  276.     RunArrayElement second;
  277. } RunArrayPair, *RunArrayPeek;
  278.  
  279. // const kRunArrayMaxIndex = (maxLong / sizeOf(RunArrayElement)) - 1;
  280.  
  281. typedef RunArrayElement *RunArrayPtr;
  282. typedef RunArrayPtr *RunArrayHandle;
  283.  
  284. typedef struct StyleTableElement {
  285.     long refCount;                    // { reference count }
  286.     WERunAttributes info;            // { style information }
  287. } StyleTableElement, *StyleTableElementPtr, **StyleTableElementHandle;
  288.  
  289. //        kStyleTableMaxIndex = (maxint div SizeOf(StyleTableElement)) - 1;
  290.  
  291. typedef StyleTableElement *StyleTablePtr;
  292. typedef StyleTablePtr *StyleTableHandle;
  293.  
  294. typedef struct LineRec {
  295.     long lineStart;                /* byte offset to first character in line */
  296.     long lineOrigin;            /* pixel offset from destRect.top */
  297.     short lineAscent;            /* maximum font ascent for this line */
  298.     short lineSlop;                /* extra pixels needed to fill up the line */
  299.     Fixed lineJustAmount;        /* normalized slop value, used for justification */
  300. } LineRec, *LinePtr, **LineHandle;
  301.  
  302.  
  303. typedef struct LinePair {
  304.     LineRec first;
  305.     LineRec second;
  306. } LinePair, *LinePeek;
  307.  
  308. //        kLineArrayMaxIndex = (maxLongInt div SizeOf(LineRec)) - 1;
  309.  
  310. typedef LineRec *LineArrayPtr;
  311. typedef LineArrayPtr *LineArrayHandle;
  312.  
  313. typedef struct    WERec {
  314.     GrafPtr port;                /* graphics port text is drawn into */
  315.     Handle hText;                /* handle to the text */
  316.     LineArrayHandle hLines;        /* handle to the line array */
  317.     StyleTableHandle hStyles;    /* handle to the style table */
  318.     RunArrayHandle hRuns;        /* handle to the style run array */
  319.     long textLength;            /* length of text */
  320.     long nLines;                /* number of lines */
  321.     long nStyles;                /* number of unique styles in the style table */
  322.     long nRuns;                    /* number of style runs */
  323.     LongRect viewRect;            /* view rectangle, all drawing is clipped to this */
  324.     LongRect destRect;            /* destination rectangle */
  325.     long selStart;                /* start of selection range */
  326.     long selEnd;                /* end of selection range */
  327.     long flags;                    /* 32 bits of miscellaneous flags */
  328.     long caretTime;                /* time of most recent caret drawing, in ticks */
  329.     long clickTime;                /* time of most recent click, in ticks */
  330.     long clickLoc;                /* byte offset of most recent click */
  331.     long anchorStart;            /* start offset of anchor word/line */
  332.     long anchorEnd;                /* end offset of anchor word/line */
  333.     ProcPtr clickLoop;            /* click loop callback */
  334.     char unused1;                /* unused */
  335.     char clickEdge;                /* edge of character hit by most recent click */
  336.     char unused2;                /* unused */
  337.     char firstByte;                /* first byte of a double-byte character */
  338.     GrafPtr offscreenPort;        /* offscreen graphics world */
  339.     RgnHandle viewRgn;            /* handle to the view region */
  340.     ProcPtr scrollProc;            /* scroll callback */
  341.     short clickCount;            /* multiple click count */    
  342.     char alignment;                /* alignment style */
  343.     long refCon;                /* reference value for client use */
  344.     TSMDocumentID tsmReference;    /* reference value for the text services manager */
  345.     long tsmAreaStart;            /* start of active input area (for TSM) */
  346.     long tsmAreaEnd;            /* end of active input area */
  347.     ProcPtr tsmPreUpdate;        /* TSM pre-update callback */
  348.     ProcPtr tsmPostUpdate;        /* TSM post-update callback */
  349.     WERunAttributes nullStyle;    /* style for null selection */
  350. } WERec, *WEPtr, **WEHandle;
  351.  
  352. #if defined(powerc) || defined (__powerc)
  353. #pragma options align=reset
  354. #endif
  355.  
  356. /*    callback prototypes */
  357.  
  358. typedef pascal Boolean (*WEClickLoopProcPtr)(WEHandle hWE);
  359. typedef pascal void (*WEScrollProcPtr)(WEHandle hWE);
  360. typedef pascal void (*WETSMPreUpdateProcPtr)(WEHandle hWE);
  361. typedef pascal void (*WETSMPostUpdateProcPtr)(WEHandle hWE,
  362.         long fixLength, long inputAreaStart, long inputAreaEnd,
  363.         long pinRangeStart, long pinRangeEnd);
  364.  
  365. typedef Boolean (*SegmentLoopProcPtr)
  366.                 (LinePtr pLine,
  367.                  WERunAttributesPtr pAttrs,
  368.                  Ptr pSegment,
  369.                  long segmentStart,
  370.                  long segmentLength,
  371.                  JustStyleCode styleRunPosition,
  372.                  void *callbackData);
  373.  
  374. struct SLDrawData {
  375.     WEPtr pWE;
  376.     Rect bounds;                /* same rectangle, but in global coords */
  377.     Boolean usingColor;            /* true if drawing in color */
  378.     Boolean usingOffscreen;        /* true if an offscreen graphics world has been set up */
  379.     Boolean drawingOffscreen;    /* true if actually drawing to an offscreen buffer */
  380.     Boolean doErase;
  381. };
  382.  
  383. struct SLCalcSlopData {
  384.     WEPtr pWE;
  385.     short lineWidth;
  386.     short totalSlop;
  387.     Fixed totalProportion;
  388. };
  389.  
  390. struct SLPixelToCharData {
  391.     WEPtr pWE;
  392.     Fixed pixelWidth;
  393.     long offset;
  394.     char *edge;
  395. };
  396.  
  397. struct SLCharToPixelData {
  398.     WEPtr pWE;
  399.     long offset;
  400.     LongPt *thePoint;
  401. };
  402.  
  403. // { ****** ASSEMBLY ROUTINES DEFINED IN WASTEUTILS.LIB ****** }
  404.  
  405. void _WEForgetHandle(Handle *h);
  406. Boolean _WESetHandleLock(Handle h, Boolean lock);
  407. void _WEBlockClr(Ptr block, long blockSize);
  408. Boolean _WEBlockCmp(Ptr block1, Ptr block2, long blockSize);
  409. OSErr _WEInsertSlot(Handle h, Ptr element, long insertAt, long slotSize);
  410. OSErr _WERemoveSlot(Handle h, long removeAt, long slotSize);
  411. void _WEReorder(long *a, long *b);
  412.  
  413. /*** in TSMSupport.c ***/
  414. OSErr _WEHiliteRangeArray(TextRangeArrayHandle hTray, WEHandle hWE);
  415. pascal OSErr _WEHandleUpdateActiveInputArea(AppleEvent *ae, AppleEvent *reply,
  416.         long handlerRefCon);
  417. pascal OSErr _WEHandlePositionToOffset(AppleEvent *ae, AppleEvent *reply,
  418.         long handlerRefCon);
  419. pascal OSErr _WEHandleOffsetToPosition(AppleEvent *ae, AppleEvent *reply, long handlerRefCon);
  420. pascal OSErr WEInstallTSMHandlers(void);
  421.  
  422. /*** in LongCoords.c ***/
  423. long _WEPinInRange(long value, long rangeStart, long rangeEnd);
  424. pascal void WELongPointToPoint(const LongPt *lp, Point *p);
  425. pascal void WEPointToLongPoint(Point p, LongPt *lp);
  426. pascal void WESetLongRect(LongRect *lr, long left, long top, long right, long bottom);
  427. pascal void WELongRectToRect(const LongRect *lr, Rect *r);
  428. pascal void WERectToLongRect(const Rect *r, LongRect *lr);
  429. pascal void WEOffsetLongRect(LongRect *lr, long hOffset, long vOffset);
  430. pascal Boolean WELongPointInLongRect(const LongPt *lp, const LongRect *lr);
  431.  
  432. /*** in WASTE1.c ***/
  433. long _WEOffsetToLine (long offset, WEHandle hWE);
  434. long _WEPixelToLine(long vOffset, WEHandle hWE);
  435. long _WEOffsetToRun (long offset, WEHandle hWE);
  436. void _WEGetIndStyle(long runIndex, WERunInfo *info, WEHandle hWE);
  437. pascal void WEGetRunInfo(long offset, WERunInfo *info, WEHandle hWE);
  438. void _WEContinuousStyleRange(long rangeStart, long rangeEnd, short *mode,
  439.         WETextStyle *ts, WEHandle hWE);
  440. void _WESynchNullStyle(WEHandle hWE);
  441. pascal Boolean WEContinuousStyle (short *mode, WETextStyle *ts, WEHandle hWE);
  442. void _WESegmentLoop(long firstLine, long lastLine, SegmentLoopProcPtr callback, void *callbackData,
  443.         WEHandle hWE);
  444. void _WEDrawTSMHilite(Rect *segmentRect, short tsFlags);
  445. void _WEDrawLines (long firstLine, long lastLine, Boolean doErase, WEHandle hWE);
  446. OSErr _WEAllocate (Size blockSize, short allocFlags, Handle *h);
  447. short _WECalcPenIndent(short slop, short alignment);
  448. void _WESaveQDEnvironment(GrafPtr port, Boolean saveColor, QDEnvironment *theEnvironment);
  449. void _WERestoreQDEnvironment(QDEnvironment *theEnvironment);
  450. void _WEFillFontInfo (GrafPtr port, WERunAttributes *targetStyle);
  451. void _WECopyStyle (WETextStyle *sourceStyle, WETextStyle *targetStyle, short offStyles,
  452.         short mode);
  453. Boolean _WEOffsetInRange(long offset, char edge, long rangeStart, long rangeEnd);
  454.  
  455. /*** in WASTE2.c ***/
  456. OSErr _WERegisterWithTSM(WEHandle hWE);
  457. pascal void WEStopInlineSession(WEHandle hWE);
  458. pascal OSErr WENew(LongRect *destRect, LongRect *viewRect, short flags, WEHandle *hWE);
  459. pascal void WEDispose(WEHandle hWE);
  460. OSErr _WERemoveLine(long lineIndex, WEPtr pWE);
  461. OSErr InsertLine(long lineIndex, LineRec *theLine, WEPtr pWE);
  462. void _WEBumpOrigin(long lineIndex, long deltaOrigin, WEPtr pWE);
  463. long _WEFindLineBreak(long lineStart, WEHandle hWE);
  464. void _WECalcHeights(long rangeStart, long rangeEnd, short *lineAscent, short *lineDescent,
  465.         WEHandle hWE);
  466. OSErr _WERecalBreaks(long *startLine, long *endLine, WEHandle hWE);
  467. void _WERecalSlops(long firstLine, long lastLine, WEHandle hWE);
  468. pascal OSErr WECalText(WEHandle hWE);
  469. pascal OSErr WEUseText(Handle text, WEHandle hWE);
  470. pascal char WEGetAlignment(WEHandle hWE);
  471. pascal void WEGetSelection(long *selStart, long *selEnd, WEHandle hWE);
  472. pascal void WESetDestRect(LongRect *destRect, WEHandle hWE);
  473. pascal void WEGetDestRect(LongRect *destRect, WEHandle hWE);
  474. pascal void WESetViewRect(LongRect *viewRect, WEHandle hWE);
  475. pascal void WEGetViewRect(LongRect *viewRect, WEHandle hWE);
  476. pascal long WEGetTextLength(WEHandle hWE);
  477. pascal long WECountLines(WEHandle hWE);
  478. pascal long WEGetHeight(long startLine, long endLine, WEHandle hWE);
  479. pascal Handle WEGetText(WEHandle hWE);
  480. pascal char WEGetChar(long offset, WEHandle hWE);
  481. pascal short WECharByte(long offset, WEHandle hWE);
  482. pascal short WECharType(long offset, WEHandle hWE);
  483. pascal OSErr WECopyRange(long rangeStart, long rangeEnd, Handle hText, WEStyleScrapHandle
  484.                     hStyles, WEHandle hWE);
  485. pascal OSErr WECopy(WEHandle hWE);
  486. pascal short WEFeatureFlag(short feature, short action, WEHandle hWE);
  487. pascal OSErr WEGetInfo(OSType selector, Ptr info, WEHandle hWE);
  488. pascal OSErr WESetInfo(OSType selector, Ptr info, WEHandle hWE);
  489.  
  490. /*** in WASTE3.c ***/
  491. void ClearHiliteBit(void);
  492. pascal long WEGetOffset(LongPt *thePoint, char *edge, WEHandle hWE);
  493. pascal void WEGetPoint(long offset, LongPt *thePoint, short *lineHeight, WEHandle hWE);
  494. pascal void WEFindLine(long offset, char edge, long *lineStart, long *lineEnd, WEHandle hWE);
  495. pascal short WEFindScriptRun(long offset, char edge, long *scriptRunStart, long *scriptRunEnd,
  496.                         WEHandle hWE);
  497. pascal void WEFindWord(long offset, char edge, long *wordStart, long *wordEnd, WEHandle hWE);
  498. void _WEDrawCaret(WEHandle hWE);
  499. pascal RgnHandle WEGetHiliteRgn(long rangeStart, long rangeEnd, WEHandle hWE);
  500. void _WEHiliteRange(long rangeStart, long rangeEnd, WEHandle hWE);
  501. pascal void WESetSelection(long selStart, long selEnd, WEHandle hWE);
  502. pascal void WEClick(Point mouseLoc, short modifiers, long clickTime, WEHandle hWE);
  503. pascal void WESetAlignment(char alignment, WEHandle hWE);
  504. long _WEArrowOffset(short action, long offset, WEHandle hWE);
  505. void _WEDoArrowKey (short arrow, short modifiers, WEHandle hWE);
  506. pascal Boolean WEAdjustCursor(Point mouseLoc, RgnHandle mouseRgn, WEHandle hWE);
  507. pascal void WEIdle(long *maxSleep, WEHandle hWE);
  508. pascal void WEUpdate(RgnHandle updateRgn, WEHandle hWE);
  509. pascal void WEDeactivate(WEHandle hWE);
  510. pascal void WEActivate(WEHandle hWE);
  511. pascal Boolean WEIsActive(WEHandle hWE);
  512. pascal void WEScroll(long hOffset, long vOffset, WEHandle hWE);
  513. Boolean _WEScrollIntoView (long offset, WEHandle hWE);
  514. pascal void WESelView(WEHandle hWE);
  515.  
  516. /*** in WASTE4.c ***/
  517. OSErr _WEInsertRun(long runIndex, long offset, long styleIndex, WEPtr pWE);
  518. OSErr _WERemoveRun(long runIndex, WEPtr pWE);
  519. void _WEChangeRun(long runIndex, long newStyleIndex, WEPtr pWE);
  520. OSErr _WENewStyle(WERunAttributes *ts, long *styleIndex, WEPtr pWE);
  521. OSErr _WERedraw(long rangeStart, long rangeEnd, WEHandle hWE);
  522. OSErr _WESetStyleRange(long rangeStart, long rangeEnd, short mode, WETextStyle *ts, WEHandle hWE);
  523. OSErr _WEApplyStyleScrap(long rangeStart, long rangeEnd, WEStyleScrapHandle styleScrap, WEHandle hWE);
  524. void _WEBumpRunStart(long runIndex, long deltaRunStart, WEPtr pWE);
  525. OSErr _WERemoveRunRange(long rangeStart, long rangeEnd, WEHandle hWE);
  526. void _WEBumpLineStart(long lineIndex, long deltaLineStart, WEPtr pWE);
  527. OSErr _WERemoveLineRange(long rangeStart, long rangeEnd, WEHandle hWE);
  528. OSErr _WEDeleteRange(long rangeStart, long rangeEnd, WEHandle hWE);
  529. OSErr _WEInsertText(long offset, Ptr textPtr, long textLength, WEHandle hWE);
  530. pascal OSErr WEDelete(WEHandle hWE);
  531. pascal OSErr WEInsert(Ptr textPtr, long textLength, WEStyleScrapHandle styleScrap, WEHandle hWE);
  532. void _WEInsertByte(char theByte, WEHandle hWE);
  533. void _WEBackspace(WEHandle hWE);
  534. pascal void WEKey(short key, short modifiers, WEHandle hWE);
  535. pascal OSErr WECut(WEHandle hWE);
  536. pascal OSErr WESetStyle(short mode, WETextStyle *ts, WEHandle hWE);
  537. pascal OSErr WEUseStyleScrap(WEStyleScrapHandle styleScrap, WEHandle hWE);
  538. pascal OSErr WEPaste(WEHandle hWE);
  539.  
  540.  
  541.  
  542.  
  543.